x86: fix resource leaks on arch_vcpu_create() error path
authorJan Beulich <jbeulich@suse.com>
Tue, 20 Oct 2020 12:44:36 +0000 (14:44 +0200)
committerJan Beulich <jbeulich@suse.com>
Tue, 20 Oct 2020 12:44:36 +0000 (14:44 +0200)
commitb081a5f14ccfe7609be63495efe8cb8c39cfb447
tree9957d378118eff44225e945dcde279b05d6aeb9c
parente9365151919c3b3ecdde6b43d31ad1e230c3342e
x86: fix resource leaks on arch_vcpu_create() error path

{hvm,pv}_vcpu_initialise() have always kind of been meant to be the
final possible source of errors in arch_vcpu_create(), hence not
requiring any unrolling of what they've done on the error path. (Of
course this may change once the various involved paths all have become
idempotent.)

But even beyond this aspect I think it is more logical to do policy
initialization ahead of the calling of these two functions, as they may
in principle want to access it.

Fixes: 4187f79dc718 ("x86/msr: introduce struct msr_vcpu_policy")
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
master commit: 6a34e67c118408ebdd62bfa7be76598ca040f170
master date: 2020-10-14 14:03:38 +0200
xen/arch/x86/domain.c